package com.lxq.test2009.Main01;


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int n,x,y;
        int[][] local;//检测点坐标
        double[][] distance = {{4000,0},{4000,0},{4000,0}};
        Scanner sc = new Scanner(System.in);

        n = sc.nextInt();


        x = sc.nextInt();
        y = sc.nextInt();

        local = new int[n][2];
        for (int i = 0 ; i < n ; i++ ){
            local[i][0] = sc.nextInt();//xi
            local[i][1] = sc.nextInt();//yi
        }

        //计算距离
        for (int i = 0 ; i < n ; i++){
            double d = Math.hypot(local[i][0]-x,local[i][1]-y);
            if(d < distance[0][0]) {
                distance[2][0] = distance[1][0];
                distance[2][1] = distance[1][1];
                distance[1][0] = distance[0][0];
                distance[1][1] = distance[0][1];
                distance[0][0] = d;
                distance[0][1] = i+1;
            }else if(d < distance[1][0] && d >= distance[0][0]){
                distance[2][0] = distance[1][0];
                distance[2][1] = distance[1][1];
                distance[1][0] = d;
                distance[1][1] = i+1;

            }else if(d < distance[2][0] && d >= distance[1][0]) {
                distance[2][0] = d;
                distance[2][1] = i+1;
            }else if(d >= distance[2][0]);//undo

        }

        System.out.println((int)distance[0][1]);
        System.out.println((int)distance[1][1]);
        System.out.println((int)distance[2][1]);
    }
}
